package com.slice.upload.base;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.core.annotation.Order;

/**
 * @ClassName StrategyAdvisor
 * @Description 策略切面
 * @Author frinder
 * @Date 2019/9/11 16:08
 * @Verion 1.0
 */
@Order(2)
@Aspect
public class StrategyAdvisor {

    @Before(value = "@annotation(strategy)")
    public void before(Strategy strategy) {
        StrategyCounter.set();
    }

    @After(value = "@annotation(strategy)")
    public void after(Strategy strategy) {
        StrategyCounter.clear();
    }

}
